<!--
*Author：jxx
 *Contact：283591387@qq.com
 *代码由框架生成,任何更改都可能导致被代码生成器覆盖
 *业务请在@/extension/service/suppliers/Supplier.jsx此处编写
 -->
<template>
    <view-grid ref="grid"
               :columns="columns"
               :detail="detail"
               :editFormFields="editFormFields"
               :editFormOptions="editFormOptions"
               :searchFormFields="searchFormFields"
               :searchFormOptions="searchFormOptions"
               :table="table"
               :extend="extend">
    </view-grid>
</template>
<script>
    import extend from "@/extension/service/suppliers/Supplier.jsx";
    import { ref, defineComponent } from "vue";
    export default defineComponent({
        setup() {
            const table = ref({
                key: 'SupplierId',
                footer: "Foots",
                cnName: '供应商名称',
                name: 'suppliers/Supplier',
                url: "base-write/api/Supplier/",
                sortName: "SupplierId"
            });
            const editFormFields = ref({"SupplierName":"","SupplierKind":"","SupplierPhone":"","SupplierFax":"","SupplierEmail":"","SupplierLinkman":"","SupplierAddress":"","SupplierDescribe":""});
            const editFormOptions = ref([[{"title":"供应商名称","field":"SupplierName"},
                               {"dataKey":"Supplier","data":[],"title":"类型","field":"SupplierKind","type":"select"}],
                              [{"title":"电话","field":"SupplierPhone","type":"phone"},
                               {"title":"传真","field":"SupplierFax"}],
                              [{"title":"Email","field":"SupplierEmail","type":"mail"},
                               {"title":"联系人","field":"SupplierLinkman"}],
                              [{"title":"地址","field":"SupplierAddress"},
                               {"title":"描述","field":"SupplierDescribe"}]]);
            const searchFormFields = ref({"SupplierName":"","SupplierKind":"","SupplierPhone":""});
            const searchFormOptions = ref([[{"title":"供应商名称","field":"SupplierName","type":"like"},{"dataKey":"Supplier","data":[],"title":"类型","field":"SupplierKind","type":"select"},{"title":"电话","field":"SupplierPhone"}]]);
            const columns = ref([{field:'SupplierId',title:'供应商编号',type:'string',width:220,hidden:true,readonly:true,require:true,align:'left'},
                       {field:'SupplierName',title:'供应商名称',type:'string',width:220,align:'left',sort:true},
                       {field:'SupplierKind',title:'类型',type:'string',bind:{ key:'Supplier',data:[]},width:220,align:'left'},
                       {field:'SupplierPhone',title:'电话',type:'string',width:220,align:'left'},
                       {field:'SupplierFax',title:'传真',type:'string',width:220,align:'left'},
                       {field:'SupplierEmail',title:'Email',type:'string',width:220,align:'left'},
                       {field:'SupplierLinkman',title:'联系人',type:'string',width:220,align:'left'},
                       {field:'SupplierAddress',title:'地址',type:'string',width:220,align:'left'},
                       {field:'SupplierDescribe',title:'描述',type:'string',width:220,align:'left'},
                       {field:'CreateTime',title:'创建时间',type:'datetime',width:150,hidden:true,align:'left',sort:true},
                       {field:'IsDeleted',title:'IsDeleted',type:'string',width:220,hidden:true,align:'left'}]);
            const detail = ref({
                cnName: "#detailCnName",
                table: "#detailTable",
                columns: [],
                sortName: "",
                key: ""
            });
            return {
                table,
                extend,
                editFormFields,
                editFormOptions,
                searchFormFields,
                searchFormOptions,
                columns,
                detail,
            };
        },
    });
</script>
